import 'package:common_utils/common_utils.dart';
import 'package:get/get_state_manager/src/rx_flutter/rx_disposable.dart';
import 'package:package_info/package_info.dart';
import 'package:sp_util/sp_util.dart';
import 'package:testlzhu/utils/common_data.dart';

class MyService extends GetxService {
  Future<MyService> init() async {
    // print('$runtimeType delays 2 sec');
    // await 2.delay();
    // print('$runtimeType ready!');

    return this;
  }

  @override
  void onInit() {
    super.onInit();
    // MMKV.initialize();
    getPackInfo();
    SpUtil.getInstance();


  }

  void getPackInfo() async{
    PackageInfo packageInfo = await PackageInfo.fromPlatform();
    CommonData.version = packageInfo.version;
    CommonData.appName = packageInfo.appName;
    CommonData.packageName = packageInfo.packageName;
    LogUtil.e("version${CommonData.version}");

  }
}
